package com.ldr.custom.spring.strategy;

import java.util.Arrays;

public class LongConvertStrategy implements ConvertStrategy {
    @Override
    public boolean isSupport(Object obj){
        return obj instanceof LongConvertStrategy;
    }

    @Override
    public Object[] convert(Object[] objs) {

        Long[] longs=new Long[objs.length];
        for (int i = 0; i < objs.length; i++) {

            longs[i]=(Long) this.convert(objs[i]);
        }
        return longs;
    }


    @Override
    public Object convert(Object obj) {

        return Long.valueOf(String.valueOf(obj));
    }
}
